import 'package:flutter_douban/model/tag_list_model.dart';
import 'package:flutter_douban/model/user_model.dart';
import 'package:json_annotation/json_annotation.dart';
part 'topic_model.g.dart';

/// 列表模型数组
class TopicModelList {
  List<TopicModel> list;
  TopicModelList(this.list);
  factory TopicModelList.fromJson(List<dynamic> list) {
    return TopicModelList(
      list.map((item) => TopicModel.fromJson(item)).toList(),
    );
  }
}

@JsonSerializable()
class TopicModel {
  /// 数量
  int? content_count;
  /// 图片
  String? cover_image;
  /// #号图片
  String? icon;
  /// id
  String? id;
  /// 图片
  String? image;
  /// 文字
  String? name;
  /// 描述
  String? description;
  /// 头像数组
  List<UserModel>? users;
  /// 标签数组
  List<TagListModel>? tag_list;

  TopicModel(this.content_count,this.cover_image,this.icon,this.id,this.image,this.name,this.description,
      this.users,this.tag_list);
  factory TopicModel.fromJson(Map<String,dynamic> json) => _$TopicModelFromJson(json);
  Map<String, dynamic> toJson() => _$TopicModelToJson(this);

}

